package org.subside.httpClient;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        String url = "https://restapi.amap.com/v3/ip";
        List<NameValuePair> list = new ArrayList<>();
        list.add(new BasicNameValuePair("key","075b6eddd825148a674dfa8a8558****"));
        String resultGet = HttpClient.doHttpGet(url,list);
        System.out.println("get请求" + resultGet);
        String resultPost = HttpClient.doPost(url,list);
        System.out.println("post请求" + resultPost);

    }
}
